
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using CStock;
using CUtil;




namespace CStock
{
	/// <summary>
	/// Summary description for DataItem
	/// </summary>
    public partial class DataItem : StockObjectBase, IDataItem
	{
        public static bool CheckDataItemSymbol(IDataItem dataItem)
        {
            Debug.Assert(dataItem != null);
            if (dataItem == null)
                return false;
            if (dataItem.Symbol == null || dataItem.Symbol == string.Empty)
            {
                System.Windows.Forms.MessageBox.Show("For getting data for equity: " + dataItem.ID + " - please set SYMBOL and retry");
                return false;
            }
            return true;
        }
        private static IQuoteBase GetLastQuote(IListQuotes qColl)
        {
            IQuoteBase qu = null;
            if (ProgramContext.Instance.Configuration.ProgramMode == ProgramModes.Realtime)
            {
                qu = qColl[DateTime.Now] as IQuoteBase;
            }
            else
            {
                qu = qColl[ProgramContext.Instance.Configuration.Dates.DateMax] as IQuoteBase;
            }
            return qu;
        }

       
    }
}
